//
//  AnnounceDetailVC.m
//  DaoZiJinFu
//
//  Created by woker on 16/8/1.
//  Copyright © 2016年 iwoker. All rights reserved.
//

#import "AnnounceDetailVC.h"

@interface AnnounceDetailVC () {
    NSString *content;
    NSString *title;
    NSString *create_time;
    NSString *ID;
    UIWebView *web;
}

@end

@implementation AnnounceDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = BACKGROUND_COLOR;
    [self leftButton:nil];
    [self setupTitleView:@"公告"];
    
    web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    web.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:web];
    
    JSVIEWSHOW;
    DZRequestUtil *request = [[DZRequestUtil alloc] init];
    request.requestUrl = @"User/getBulletinDetail";
    request.params = @{@"id":_idStr};
    [DZNetAPI request:request success:^(id response) {
        DZResponse *model = [DZResponse mj_objectWithKeyValues:response];
        JSVIEWHIDE;
        if (model.rt == 1) {
            content = model.data[@"content"];
            title = model.data[@"title"];
            create_time = model.data[@"create_time"];
            ID = model.data[@"id"];
            [web loadHTMLString:content baseURL:nil];
        }else{
            JSSHOW(model.msg);
        }
    } failure:^(NSError *error) {
        JSVIEWHIDE;
        JSSHOW(LOAD_FAIL_TIP);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
